home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / msdos / compresn / dvpeg / src / svgamode.asm < prev   
Encoding:
Assembly Source File  |  1992-05-04  |  1.7 KB  |  95 lines

  1.  
  2.     include model.h
  3.  
  4. ;
  5. ;    VGAKIT Version 4.1
  6. ;
  7. ;    Copyright 1988,89,90,91 John Bridges
  8. ;    Free for use in commercial, shareware or freeware applications
  9. ;
  10. ;    SVGAMODE.ASM
  11. ;
  12. ;
  13. .data
  14.     extrn    cirrus:byte,everex:byte,paradise:byte,tseng:byte,trident:byte
  15.     extrn    t8900:byte,ativga:byte,aheada:byte,aheadb:byte
  16.     extrn    oaktech:byte,video7:byte,chipstech:byte,tseng4:byte,genoa:byte
  17.     extrn    ncr:byte,compaq:byte,vesa:byte
  18.     extrn    vga512:byte,vga1024:byte
  19.  
  20.     extrn    curbk:word
  21.  
  22.     public    maxx,maxy,xwidth
  23.  
  24. maxx    dw    ?        ;xwidth of screen in pixels
  25. maxy    dw    ?        ;height of screen in pixels
  26. xwidth    dw    ?        ;actual xwidth of screen in bytes
  27.  
  28. .code
  29.  
  30.     public    svgamode
  31.     public    txtmode
  32.     public    setmany
  33.  
  34. svgamode proc vid_mode, max_x:word            ;Set 640x480x256 on most SVGA cards
  35.     mov ax, [vid_mode]
  36.     cmp    [vesa],0            ; override for vesa since its special
  37.     jz    notvesa
  38.     mov    ax,4f02h
  39.     mov    bx,101h
  40.     jmp    setupmode
  41. notvesa:
  42.     cmp [video7], 0        ; special case for these cards
  43.     jz notvid7
  44.     mov bl,67h
  45.     jmp setupmode
  46. notvid7:
  47.     cmp [everex], 0        ; another special
  48.     jz setupmode
  49.     mov bl, 30h
  50.  
  51. setupmode:
  52.     int    10h
  53.  
  54.     mov    [curbk],-1
  55.     mov    ax,max_x
  56.     mov    [maxx],ax        ;default xwidth to whatever for now
  57.     cmp    [compaq],0
  58.     jz    nokludge
  59.     mov    ax,1024
  60. nokludge:
  61.     mov    [xwidth],ax
  62.     mov    ax,40h
  63.     mov    es,ax
  64.     mov    al,es:[84h]        ;get height of screen
  65.     inc    al
  66.     mul    byte ptr es:[85h]
  67.     mov    [maxy],ax
  68.  
  69. nots:    ret
  70. svgamode endp
  71.  
  72. txtmode    proc
  73.     mov    ax,3
  74.     int    10h
  75.     ret
  76. txtmode    endp
  77.  
  78. setmany proc    palbuf:ptr byte,begcol:word,numcol:word
  79. if @Datasize
  80.     les    dx,[palbuf]
  81. else
  82.     mov    ax,ds
  83.     mov    es,ax
  84.     mov    dx,[palbuf]
  85. endif
  86.     mov    bx,[begcol]
  87.     mov    cx,[numcol]
  88.     mov    ax,1012h
  89.     int    10h
  90.     ret
  91. setmany endp
  92.  
  93.     end
  94.  
  95.